package com.slj.controller;

import com.slj.entity.BookTypes;
import com.slj.service.BookTypesService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/bookTypes")
@CrossOrigin(origins = "*")
@RequiredArgsConstructor
public class BookTypesController {
    private final BookTypesService bookTypesService;
    //获取书籍类型
    @GetMapping("/getAllBookTypes")
    public List<BookTypes> getBookTypes() {
        List<BookTypes> bookTypes = bookTypesService.getBookTypes();
        return bookTypes;
    }
}
